﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;

public partial class BaseData_ProductSeason : System.Web.UI.Page
{
    protected void Page_PreInit(object sender, EventArgs e)
    {
        Page.Theme = BLL.Common.GetWSMThemes();
    }
    
    protected void Page_Load(object sender, EventArgs e)
    {
        Check.CheckPermission("200200107");
        if (!IsPostBack)
        {
            AspNetPager1.PageSize = Convert.ToInt32(ConfigurationManager.AppSettings["RowCountPerPage"].ToString());
            SearchControl1.InitParam("JIJIE", "JJDM", "JJMC", "JIJIEListControl1", "rptJIJIE", "AspNetPager1");
            Bind();
        }
    }
    private void Bind()
    {
        int pageCount, rowCount;
        List<Model.JIJIE> seasons = new BLL.JIJIE().GetList(AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex, "JJDM", false, "", out pageCount, out rowCount);
        JIJIEListControl1.Bind(seasons);
        AspNetPager1.RecordCount = rowCount;
    }
    protected void AspNetPager1_PageChanged(object sender, EventArgs e)
    {
        int pageCount, rowCount;
        if (SearchControl1.IsSearchResult)
        {
            Repeater rpt = (Repeater)JIJIEListControl1.FindControl("rptJIJIE");
            if (rpt != null)
            {
                string strSql;
                SearchControl1.BindParentPageControl(rpt, AspNetPager1, SearchControl1.DataTableName, SearchControl1.PrimaryKeyColumnName, SearchControl1.StrCondition, AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex, out pageCount, out rowCount, out strSql);
            }
        }
        else
        {
            List<Model.JIJIE> colors = new BLL.JIJIE().GetList(AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex, "JJDM", false, "", out pageCount, out rowCount);
            JIJIEListControl1.Bind(colors);
        }
    }
}
